home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / portmap.shar / portmap.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-06  |  15.2 KB  |  607 lines

  1. /*-
  2.  * Copyright (c) 1990 The Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  * 1. Redistributions of source code must retain the above copyright
  9.  *    notice, this list of conditions and the following disclaimer.
  10.  * 2. Redistributions in binary form must reproduce the above copyright
  11.  *    notice, this list of conditions and the following disclaimer in the
  12.  *    documentation and/or other materials provided with the distribution.
  13.  * 3. All advertising materials mentioning features or use of this software
  14.  *    must display the following acknowledgement:
  15.  *    This product includes software developed by the University of
  16.  *    California, Berkeley and its contributors.
  17.  * 4. Neither the name of the University nor the names of its contributors
  18.  *    may be used to endorse or promote products derived from this software
  19.  *    without specific prior written permission.
  20.  *
  21.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31.  * SUCH DAMAGE.
  32.  */
  33.  
  34. #ifndef lint
  35. char copyright[] =
  36. "@(#) Copyright (c) 1990 The Regents of the University of California.\n\
  37.  All rights reserved.\n";
  38. #endif /* not lint */
  39.  
  40. #ifndef lint
  41. static char sccsid[] = "@(#)portmap.c    5.4 (Berkeley) 4/19/91";
  42. #endif /* not lint */
  43.  
  44. /*
  45. @(#)portmap.c    2.3 88/08/11 4.0 RPCSRC
  46. static char sccsid[] = "@(#)portmap.c 1.32 87/08/06 Copyr 1984 Sun Micro";
  47. */
  48.  
  49. /*
  50.  * portmap.c, Implements the program,version to port number mapping for
  51.  * rpc.
  52.  */
  53.  
  54. /*
  55.  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  56.  * unrestricted use provided that this legend is included on all tape
  57.  * media and as a part of the software program in whole or part.  Users
  58.  * may copy or modify Sun RPC without charge, but are not authorized
  59.  * to license or distribute it to anyone else except as part of a product or
  60.  * program developed by the user.
  61.  * 
  62.  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  63.  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  64.  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  65.  * 
  66.  * Sun RPC is provided with no support and without any obligation on the
  67.  * part of Sun Microsystems, Inc. to assist in its use, correction,
  68.  * modification or enhancement.
  69.  * 
  70.  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  71.  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  72.  * OR ANY PART THEREOF.
  73.  * 
  74.  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  75.  * or profits or other special, indirect and consequential damages, even if
  76.  * Sun has been advised of the possibility of such damages.
  77.  * 
  78.  * Sun Microsystems, Inc.
  79.  * 2550 Garcia Avenue
  80.  * Mountain View, California  94043
  81.  */
  82.  
  83. #include <rpc/rpc.h>
  84. #include <rpc/pmap_prot.h>
  85. #include <stdio.h>
  86. #include <syslog.h>
  87. #include <netdb.h>
  88. #include <sys/socket.h>
  89. #include <sys/ioctl.h>
  90. #include <sys/wait.h>
  91. #include <sys/signal.h>
  92. #include <sys/time.h>
  93. #include <sys/resource.h>
  94. #ifdef SYSV40
  95. #include <netinet/in.h>
  96. #endif
  97.  
  98. extern char *strerror();
  99. extern char *malloc();
  100.  
  101. #ifndef LOG_PERROR
  102. #define LOG_PERROR 0
  103. #endif
  104.  
  105. #ifndef LOG_DAEMON
  106. #define LOG_DAEMON 0
  107. #endif
  108.  
  109. #ifndef svc_getcaller        /* SYSV4 */
  110. #  define svc_getcaller svc_getrpccaller
  111. #endif
  112.  
  113. void reg_service();
  114. void reap();
  115. static void callit();
  116. struct pmaplist *pmaplist;
  117. int debugging = 0;
  118. extern int errno;
  119.  
  120. #include "pmap_check.h"
  121.  
  122. main(argc, argv)
  123.     int argc;
  124.     char **argv;
  125. {
  126.     SVCXPRT *xprt;
  127.     int sock, c;
  128.     struct sockaddr_in addr;
  129.     int len = sizeof(struct sockaddr_in);
  130.     register struct pmaplist *pml;
  131.  
  132.     while ((c = getopt(argc, argv, "d")) != EOF) {
  133.         switch (c) {
  134.  
  135.         case 'd':
  136.             debugging = 1;
  137.             break;
  138.  
  139.         default:
  140.             (void) fprintf(stderr, "usage: %s [-d]\n", argv[0]);
  141.             exit(1);
  142.         }
  143.     }
  144.  
  145.     if (!debugging && daemon(0, 0)) {
  146.         (void) fprintf(stderr, "portmap: fork: %s", strerror(errno));
  147.         exit(1);
  148.     }
  149.  
  150. #ifdef LOG_MAIL
  151.     openlog("portmap", debugging ? LOG_PID | LOG_PERROR : LOG_PID,
  152.         FACILITY);
  153. #else
  154.     openlog("portmap", debugging ? LOG_PID | LOG_PERROR : LOG_PID);
  155. #endif
  156.  
  157.     if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
  158.         syslog(LOG_ERR, "cannot create udp socket: %m");
  159.         exit(1);
  160.     }
  161.  
  162.     addr.sin_addr.s_addr = 0;
  163.     addr.sin_family = AF_INET;
  164.     addr.sin_port = htons(PMAPPORT);
  165.     if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
  166.         syslog(LOG_ERR, "cannot bind udp: %m");
  167.         exit(1);
  168.     }
  169.  
  170.     if ((xprt = svcudp_create(sock)) == (SVCXPRT *)NULL) {
  171.         syslog(LOG_ERR, "couldn't do udp_create");
  172.         exit(1);
  173.     }
  174.     /* make an entry for ourself */
  175.     pml = (struct pmaplist *)malloc((u_int)sizeof(struct pmaplist));
  176.     pml->pml_next = 0;
  177.     pml->pml_map.pm_prog = PMAPPROG;
  178.     pml->pml_map.pm_vers = PMAPVERS;
  179.     pml->pml_map.pm_prot = IPPROTO_UDP;
  180.     pml->pml_map.pm_port = PMAPPORT;
  181.     pmaplist = pml;
  182.  
  183.     if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) {
  184.         syslog(LOG_ERR, "cannot create tcp socket: %m");
  185.         exit(1);
  186.     }
  187.     if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
  188.         syslog(LOG_ERR, "cannot bind udp: %m");
  189.         exit(1);
  190.     }
  191.     if ((xprt = svctcp_create(sock, RPCSMALLMSGSIZE, RPCSMALLMSGSIZE))
  192.         == (SVCXPRT *)NULL) {
  193.         syslog(LOG_ERR, "couldn't do tcp_create");
  194.         exit(1);
  195.     }
  196.     /* make an entry for ourself */
  197.     pml = (struct pmaplist *)malloc((u_int)sizeof(struct pmaplist));
  198.     pml->pml_map.pm_prog = PMAPPROG;
  199.     pml->pml_map.pm_vers = PMAPVERS;
  200.     pml->pml_map.pm_prot = IPPROTO_TCP;
  201.     pml->pml_map.pm_port = PMAPPORT;
  202.     pml->pml_next = pmaplist;
  203.     pmaplist = pml;
  204.  
  205.     (void)svc_register(xprt, PMAPPROG, PMAPVERS, reg_service, FALSE);
  206.  
  207.     /* additional initializations */
  208.     check_startup();
  209.     (void)signal(SIGCHLD, reap);
  210.     svc_run();
  211.     syslog(LOG_ERR, "run_svc returned unexpectedly");
  212.     abort();
  213. }
  214.  
  215. #ifndef lint
  216. /* need to override perror calls in rpc library */
  217. void
  218. perror(what)
  219.     const char *what;
  220. {
  221.  
  222.     syslog(LOG_ERR, "%s: %m", what);
  223. }
  224. #endif
  225.  
  226. static struct pmaplist *
  227. find_service(prog, vers, prot)
  228.     u_long prog, vers, prot;
  229. {
  230.     register struct pmaplist *hit = NULL;
  231.     register struct pmaplist *pml;
  232.  
  233.     for (pml = pmaplist; pml != NULL; pml = pml->pml_next) {
  234.         if ((pml->pml_map.pm_prog != prog) ||
  235.             (pml->pml_map.pm_prot != prot))
  236.             continue;
  237.         hit = pml;
  238.         if (pml->pml_map.pm_vers == vers)
  239.             break;
  240.     }
  241.     return (hit);
  242. }
  243.  
  244. /* 
  245.  * 1 OK, 0 not
  246.  */
  247. void
  248. reg_service(rqstp, xprt)
  249.     struct svc_req *rqstp;
  250.     SVCXPRT *xprt;
  251. {
  252.     struct pmap reg;
  253.     struct pmaplist *pml, *prevpml, *fnd;
  254.     int ans, port;
  255.     caddr_t t;
  256.     
  257.     if (debugging)
  258.         (void) fprintf(stderr, "server: about do a switch\n");
  259.     switch (rqstp->rq_proc) {
  260.  
  261.     case PMAPPROC_NULL:
  262.         /*
  263.          * Null proc call
  264.          */
  265.         /* remote host authorization check */
  266.         check_default(svc_getcaller(xprt), rqstp->rq_proc, (u_long) 0);
  267.         if (!svc_sendreply(xprt, xdr_void, (caddr_t)0) && debugging) {
  268.             abort();
  269.         }
  270.         break;
  271.  
  272.     case PMAPPROC_SET:
  273.         /*
  274.          * Set a program,version to port mapping
  275.          */
  276.         if (!svc_getargs(xprt, xdr_pmap, ®))
  277.             svcerr_decode(xprt);
  278.         else {
  279.             /* reject non-local requests, protect priv. ports */
  280.             if (!check_setunset(svc_getcaller(xprt), 
  281.                 rqstp->rq_proc, reg.pm_prog, reg.pm_port)) {
  282.                 ans = 0;
  283.                 goto done;
  284.             } 
  285.             /*
  286.              * check to see if already used
  287.              * find_service returns a hit even if
  288.              * the versions don't match, so check for it
  289.              */
  290.             fnd = find_service(reg.pm_prog, reg.pm_vers, reg.pm_prot);
  291.             if (fnd && fnd->pml_map.pm_vers == reg.pm_vers) {
  292.                 if (fnd->pml_map.pm_port == reg.pm_port) {
  293.                     ans = 1;
  294.                     goto done;
  295.                 }
  296.                 else {
  297.                     ans = 0;
  298.                     goto done;
  299.                 }
  300.             } else {
  301.                 /* 
  302.                  * add to END of list
  303.                  */
  304.                 pml = (struct pmaplist *)
  305.                     malloc((u_int)sizeof(struct pmaplist));
  306.                 pml->pml_map = reg;
  307.                 pml->pml_next = 0;
  308.                 if (pmaplist == 0) {
  309.                     pmaplist = pml;
  310.                 } else {
  311.                     for (fnd= pmaplist; fnd->pml_next != 0;
  312.                         fnd = fnd->pml_next);
  313.                     fnd->pml_next = pml;
  314.                 }
  315.                 ans = 1;
  316.             }
  317.         done:
  318.             if ((!svc_sendreply(xprt, xdr_long, (caddr_t)&ans)) &&
  319.                 debugging) {
  320.                 (void) fprintf(stderr, "svc_sendreply\n");
  321.                 abort();
  322.             }
  323.         }
  324.         break;
  325.  
  326.     case PMAPPROC_UNSET:
  327.         /*
  328.          * Remove a program,version to port mapping.
  329.          */
  330.         if (!svc_getargs(xprt, xdr_pmap, ®))
  331.             svcerr_decode(xprt);
  332.         else {
  333.             ans = 0;
  334.             /* reject non-local requests */
  335.             if (!check_setunset(svc_getcaller(xprt), 
  336.                 rqstp->rq_proc, reg.pm_prog, (u_long) 0))
  337.                 goto done;
  338.             for (prevpml = NULL, pml = pmaplist; pml != NULL; ) {
  339.                 if ((pml->pml_map.pm_prog != reg.pm_prog) ||
  340.                     (pml->pml_map.pm_vers != reg.pm_vers)) {
  341.                     /* both pml & prevpml move forwards */
  342.                     prevpml = pml;
  343.                     pml = pml->pml_next;
  344.                     continue;
  345.                 }
  346.                 /* found it; pml moves forward, prevpml stays */
  347.                 /* privileged port check */
  348.                 if (!check_privileged_port(svc_getcaller(xprt), 
  349.                     rqstp->rq_proc, 
  350.                     reg.pm_prog, 
  351.                     pml->pml_map.pm_port)) {
  352.                     ans = 0;
  353.                     break;
  354.                 }
  355.                 ans = 1;
  356.                 t = (caddr_t)pml;
  357.                 pml = pml->pml_next;
  358.                 if (prevpml == NULL)
  359.                     pmaplist = pml;
  360.                 else
  361.                     prevpml->pml_next = pml;
  362.                 free(t);
  363.             }
  364.             if ((!svc_sendreply(xprt, xdr_long, (caddr_t)&ans)) &&
  365.                 debugging) {
  366.                 (void) fprintf(stderr, "svc_sendreply\n");
  367.                 abort();
  368.             }
  369.         }
  370.         break;
  371.  
  372.     case PMAPPROC_GETPORT:
  373.         /*
  374.          * Lookup the mapping for a program,version and return its port
  375.          */
  376.         if (!svc_getargs(xprt, xdr_pmap, ®))
  377.             svcerr_decode(xprt);
  378.         else {
  379.             /* remote host authorization check */
  380.             if (!check_default(svc_getcaller(xprt), 
  381.                 rqstp->rq_proc, 
  382.                 reg.pm_prog)) {
  383.                 ans = 0;
  384.                 goto done;
  385.             }
  386.             fnd = find_service(reg.pm_prog, reg.pm_vers, reg.pm_prot);
  387.             if (fnd)
  388.                 port = fnd->pml_map.pm_port;
  389.             else
  390.                 port = 0;
  391.             if ((!svc_sendreply(xprt, xdr_long, (caddr_t)&port)) &&
  392.                 debugging) {
  393.                 (void) fprintf(stderr, "svc_sendreply\n");
  394.                 abort();
  395.             }
  396.         }
  397.         break;
  398.  
  399.     case PMAPPROC_DUMP:
  400.         /*
  401.          * Return the current set of mapped program,version
  402.          */
  403.         if (!svc_getargs(xprt, xdr_void, NULL))
  404.             svcerr_decode(xprt);
  405.         else {
  406.             /* remote host authorization check */
  407.             struct pmaplist *p;
  408.             if (!check_default(svc_getcaller(xprt), 
  409.                 rqstp->rq_proc, (u_long) 0)) {
  410.                 p = 0;    /* send empty list */
  411.             } else {
  412.                 p = pmaplist;
  413.             }
  414.             if ((!svc_sendreply(xprt, xdr_pmaplist,
  415.                 (caddr_t)&p)) && debugging) {
  416.                 (void) fprintf(stderr, "svc_sendreply\n");
  417.                 abort();
  418.             }
  419.         }
  420.         break;
  421.  
  422.     case PMAPPROC_CALLIT:
  423.         /*
  424.          * Calls a procedure on the local machine.  If the requested
  425.          * procedure is not registered this procedure does not return
  426.          * error information!!
  427.          * This procedure is only supported on rpc/udp and calls via 
  428.          * rpc/udp.  It passes null authentication parameters.
  429.          */
  430.         callit(rqstp, xprt);
  431.         break;
  432.  
  433.     default:
  434.         /* remote host authorization check */
  435.         check_default(svc_getcaller(xprt), rqstp->rq_proc, (u_long) 0);
  436.         svcerr_noproc(xprt);
  437.         break;
  438.     }
  439. }
  440.  
  441.  
  442. /*
  443.  * Stuff for the rmtcall service
  444.  */
  445. #define ARGSIZE 9000
  446.  
  447. struct encap_parms {
  448.     u_long arglen;
  449.     char *args;
  450. };
  451.  
  452. static bool_t
  453. xdr_encap_parms(xdrs, epp)
  454.     XDR *xdrs;
  455.     struct encap_parms *epp;
  456. {
  457.  
  458.     return (xdr_bytes(xdrs, &(epp->args), &(epp->arglen), ARGSIZE));
  459. }
  460.  
  461. struct rmtcallargs {
  462.     u_long    rmt_prog;
  463.     u_long    rmt_vers;
  464.     u_long    rmt_port;
  465.     u_long    rmt_proc;
  466.     struct encap_parms rmt_args;
  467. };
  468.  
  469. static bool_t
  470. xdr_rmtcall_args(xdrs, cap)
  471.     register XDR *xdrs;
  472.     register struct rmtcallargs *cap;
  473. {
  474.  
  475.     /* does not get a port number */
  476.     if (xdr_u_long(xdrs, &(cap->rmt_prog)) &&
  477.         xdr_u_long(xdrs, &(cap->rmt_vers)) &&
  478.         xdr_u_long(xdrs, &(cap->rmt_proc))) {
  479.         return (xdr_encap_parms(xdrs, &(cap->rmt_args)));
  480.     }
  481.     return (FALSE);
  482. }
  483.  
  484. static bool_t
  485. xdr_rmtcall_result(xdrs, cap)
  486.     register XDR *xdrs;
  487.     register struct rmtcallargs *cap;
  488. {
  489.     if (xdr_u_long(xdrs, &(cap->rmt_port)))
  490.         return (xdr_encap_parms(xdrs, &(cap->rmt_args)));
  491.     return (FALSE);
  492. }
  493.  
  494. /*
  495.  * only worries about the struct encap_parms part of struct rmtcallargs.
  496.  * The arglen must already be set!!
  497.  */
  498. static bool_t
  499. xdr_opaque_parms(xdrs, cap)
  500.     XDR *xdrs;
  501.     struct rmtcallargs *cap;
  502. {
  503.  
  504.     return (xdr_opaque(xdrs, cap->rmt_args.args, cap->rmt_args.arglen));
  505. }
  506.  
  507. /*
  508.  * This routine finds and sets the length of incoming opaque paraters
  509.  * and then calls xdr_opaque_parms.
  510.  */
  511. static bool_t
  512. xdr_len_opaque_parms(xdrs, cap)
  513.     register XDR *xdrs;
  514.     struct rmtcallargs *cap;
  515. {
  516.     register u_int beginpos, lowpos, highpos, currpos, pos;
  517.  
  518.     beginpos = lowpos = pos = xdr_getpos(xdrs);
  519.     highpos = lowpos + ARGSIZE;
  520.     while ((int)(highpos - lowpos) >= 0) {
  521.         currpos = (lowpos + highpos) / 2;
  522.         if (xdr_setpos(xdrs, currpos)) {
  523.             pos = currpos;
  524.             lowpos = currpos + 1;
  525.         } else {
  526.             highpos = currpos - 1;
  527.         }
  528.     }
  529.     xdr_setpos(xdrs, beginpos);
  530.     cap->rmt_args.arglen = pos - beginpos;
  531.     return (xdr_opaque_parms(xdrs, cap));
  532. }
  533.  
  534. /*
  535.  * Call a remote procedure service
  536.  * This procedure is very quiet when things go wrong.
  537.  * The proc is written to support broadcast rpc.  In the broadcast case,
  538.  * a machine should shut-up instead of complain, less the requestor be
  539.  * overrun with complaints at the expense of not hearing a valid reply ...
  540.  *
  541.  * This now forks so that the program & process that it calls can call 
  542.  * back to the portmapper.
  543.  */
  544. static void
  545. callit(rqstp, xprt)
  546.     struct svc_req *rqstp;
  547.     SVCXPRT *xprt;
  548. {
  549.     struct rmtcallargs a;
  550.     struct pmaplist *pml;
  551.     u_short port;
  552.     struct sockaddr_in me;
  553.     int pid, so = -1;
  554.     CLIENT *client;
  555.     struct authunix_parms *au = (struct authunix_parms *)rqstp->rq_clntcred;
  556.     struct timeval timeout;
  557.     char buf[ARGSIZE];
  558.  
  559.     timeout.tv_sec = 5;
  560.     timeout.tv_usec = 0;
  561.     a.rmt_args.args = buf;
  562.     if (!svc_getargs(xprt, xdr_rmtcall_args, &a))
  563.         return;
  564.     /* host and service access control */
  565.     if (!check_callit(svc_getcaller(xprt), 
  566.         rqstp->rq_proc, a.rmt_prog, a.rmt_proc))
  567.         return;
  568.     if ((pml = find_service(a.rmt_prog, a.rmt_vers,
  569.         (u_long)IPPROTO_UDP)) == NULL)
  570.         return;
  571.     /*
  572.      * fork a child to do the work.  Parent immediately returns.
  573.      * Child exits upon completion.
  574.      */
  575.     if ((pid = fork()) != 0) {
  576.         if (pid < 0)
  577.             syslog(LOG_ERR, "CALLIT (prog %lu): fork: %m",
  578.                 a.rmt_prog);
  579.         return;
  580.     }
  581.     port = pml->pml_map.pm_port;
  582.     get_myaddress(&me);
  583.     me.sin_port = htons(port);
  584.     client = clntudp_create(&me, a.rmt_prog, a.rmt_vers, timeout, &so);
  585.     if (client != (CLIENT *)NULL) {
  586.         if (rqstp->rq_cred.oa_flavor == AUTH_UNIX) {
  587.             client->cl_auth = authunix_create(au->aup_machname,
  588.                au->aup_uid, au->aup_gid, au->aup_len, au->aup_gids);
  589.         }
  590.         a.rmt_port = (u_long)port;
  591.         if (clnt_call(client, a.rmt_proc, xdr_opaque_parms, &a,
  592.             xdr_len_opaque_parms, &a, timeout) == RPC_SUCCESS) {
  593.             svc_sendreply(xprt, xdr_rmtcall_result, (caddr_t)&a);
  594.         }
  595.         AUTH_DESTROY(client->cl_auth);
  596.         clnt_destroy(client);
  597.     }
  598.     (void)close(so);
  599.     exit(0);
  600. }
  601.  
  602. void
  603. reap()
  604. {
  605.     while (wait3((int *)NULL, WNOHANG, (struct rusage *)NULL) > 0);
  606. }
  607.